﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Clipper.Model.DataBaseModel
{
    public class DisplayCup : AbstractModel
    {

        private int cupSeatID;//杯子id

        private int sampleInfoID;//样本号

        private string detectItem;//检测项

        private string cupStatus; //杯子状态

        DisplayCup display; //展示杯子状态

        //private string detectResult;//杯子结果

        public enum CheckCancelEnum
        {
            CANCEL,//取消操作
            NOTCAN

        }
        private ReaderWriterLockSlim rwLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);

        private CheckCancelEnum status = CheckCancelEnum.NOTCAN;

        public void setStatus(CheckCancelEnum state)
        {
            rwLock.EnterWriteLock();
            try
            {
                this.status = state;
            }
            finally
            {
                rwLock.ExitWriteLock();
            }
        }

        public CheckCancelEnum getStatus()
        {
            rwLock.EnterReadLock();
            try
            {
                return this.status;
            }
            finally
            {
                rwLock.ExitReadLock();
            }
        }

        public int CupSeatID
        {
            get
            {
                return cupSeatID;
            }

            set
            {
                cupSeatID = value;
                NotifyPropertyChanged("CupSeatID");
            }
        }

        public int SampleInfoID
        {
            get
            {
                return sampleInfoID;
            }

            set
            {
                sampleInfoID = value;
                NotifyPropertyChanged("SampleInfoID");
            }
        }

        public string DetectItem
        {
            get
            {
                return detectItem;
            }

            set
            {
                detectItem = value;
                NotifyPropertyChanged("DetectItem");
            }
        }

        public string CupStatus
        {
            get
            {
                return cupStatus;
            }

            set
            {
                cupStatus = value;
                NotifyPropertyChanged("CupStatus");
            }
        }
    }
}
